% % function y = sqr_rc(L,eta,betta) % % % L = pulse length (length times the symbol time) % eta = oversampling (# points per T) % betta = roll off factor 0 < betta < 1 % % % Written by P. Orten, july 1996 function y = sqr_rc(L,eta,betta) if (rem(L*eta,2) == 1) i=(L*eta+1)/2; % odd number of taps for k = 1/eta:1/eta:L/2 i= i+1; if ( k == 1/(4*betta) ) k = k +0.000000001 end h1(i)= sin( pi*(1-betta)*(k)) ... /( pi*(1-(4*betta*(k)) ^2)*(k)); h2(i) = 4*betta*(k)*cos(pi*(1+betta)*(k)) ... /( pi*(1-(4*betta*(k)) ^2)*(k)); h1(L*eta-i+1) = h1(i); h2(L*eta-i+1) = h2(i); end h= h1+h2; h((L*eta+1)/2) = (4*betta+pi*(1-betta)) / pi; else i=(L*eta)/2; % even number of coefficients for k = 1/eta/2:1/eta:L/2 i= i+1; if ( k == 1/(4*betta) ) k = k +0.000000001 end h1(i)= sin( pi*(1-betta)*(k)) ... /( pi*(1-(4*betta*(k)) ^2)*(k)); h2(i) = 4*betta*(k)*cos(pi*(1+betta)*(k)) ... /( pi*(1-(4*betta*(k)) ^2)*(k)); h1(L*eta-i+1) = h1(i); h2(L*eta-i+1) = h2(i); end h = h1+h2; end %if rem y= h; return;